package Task6_4;

import java.io.*;

/**
 * @author Administrator
 */
public class Task6_4 {
    public static void main(String[] args) throws IOException {
        long start =System.currentTimeMillis();
        methodl("d:\\copy.mp4","copy.mp4");
        //method2("d:\\copy.mp4","copy2.mp4");
        //method3("d:\\copy.mp4","copy3.mp4");
        //method4("d:\\copy.mp4","copy4.mp4");
        long end=System.currentTimeMillis();
        System.out.println("共耗时"+(end - start)+"毫秒");
    }

    private static void method4(String s, String s1) {
    }

    private static void method3(String s, String s1) {
    }

    private static void method2(String s, String s1) {
    }

    private static void methodl(String srcString, String destString) throws IOException {
        BufferedInputStream t1 =new BufferedInputStream(new FileInputStream("D:\\copy.mp4"));
        BufferedOutputStream t2=new BufferedOutputStream(new FileOutputStream("copy.mp4"));
        byte[] bytes=new byte[1024];
        int len=0;
        while ((len=t1.read(bytes))!=-1){
            t2.write(bytes,0,len);
        }
        t1.close();
        t2.close();
    }

}
